import { type RouteRecordRaw } from 'vue-router';

const Layout = () => import('@/layout/index.vue');

/**
 * 开发模式 功能展示模块路由
 */
export const abilityRoutes: RouteRecordRaw[] = [
  {
    path: '/ability',
    name: 'Ability',
    component: Layout,
    redirect: '/ability/pdf',
    meta: {
      title: '功能展示',
      icon: 'client',
      hidden: false,
      alwaysShow: true,
      params: null,
    },
    children: [
      {
        path: 'tree-line',
        name: 'TreeLine',
        component: () => import('@/views/ability/tree-line/index.vue'),
        meta: {
          title: '树形组件连线',
          icon: 'cascader',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'split-panel',
        name: 'SplitPanel',
        component: () => import('@/views/ability/split-panel/index.vue'),
        meta: {
          title: '分割面板',
          icon: 'resizer',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'vtable',
        name: 'VTable',
        component: () => import('@/views/ability/vtable/index.vue'),
        meta: {
          title: 'vtable组件',
          icon: 'table',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'others',
        name: 'Others',
        component: () => import('@/views/ability/others/index.vue'),
        meta: {
          title: '其他功能',
          icon: 'menu',
          affix: false,
          keepAlive: true,
        },
      },
      {
        path: 'level',
        name: 'Level',
        // component: () => import('@/views/ability/level/index.vue'),
        redirect: '/ability/level/level1',
        meta: {
          title: '多级路由',
          icon: 'cascader',
          affix: false,
          alwaysShow: true,
          hidden: false,
          keepAlive: true,
        },
        children: [
          {
            path: 'level1',
            name: 'Level1',
            component: () => import('@/views/ability/level/children/level1.vue'),
            meta: {
              title: '次级路由',
              icon: 'menu',
              affix: false,
              hidden: false,
              keepAlive: true,
            },
          },
          {
            path: 'level2',
            name: 'Level2',
            component: () => import('@/views/ability/level/children/level2.vue'),
            meta: {
              title: '次级路由2',
              icon: 'menu',
              affix: false,
              hidden: false,
              keepAlive: false,
            },
          },
        ],
      },
    ],
  },
];
